package com.bootdo.common.controller;/**
 * @author jafar.tang
 * @date 2018/9/19 17:10
 * @description
 */

import com.bootdo.common.dao.AssistantDao;
import com.bootdo.common.domain.AssistantEnumVO;
import com.bootdo.common.domain.AssistantTableVO;
import com.bootdo.common.utils.R;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created on 2018/09/19.
 * Description:
 * Copyright (c) 2018, 成都冰鉴信息科技有限公司
 * All rights reserved.
 *
 * @author jafar.tang
 */
@Controller
@RequestMapping("/assistant")
public class AssistantController {

    @Resource
    AssistantDao assistantDao;

    @GetMapping("/tables")
    public String tables(Model m) {
        List<AssistantTableVO> tables = assistantDao.listAllTables();
        m.addAttribute("tables", tables);

        //所有枚举
        List<AssistantEnumVO> enums = new ArrayList<>();
        try {
//            enums.add(AssistantEnumVO.ok("错误类型代码", R.ErrorCodes.class));
        } catch (Exception e) { e.printStackTrace(); }
        m.addAttribute("enums", enums);
        return "assistant";
    }

}
